// OpenGLInfoDlg.cpp : implementation file
//

#include "stdafx.h"
#include "TerrainEditor.h"
#include "OpenGLInfoDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COpenGLInfoDlg dialog


COpenGLInfoDlg::COpenGLInfoDlg(CWnd* pParent /*=NULL*/)
	: CDialog(COpenGLInfoDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(COpenGLInfoDlg)
	m_Company = _T("");
	m_Renderer = _T("");
	m_Version = _T("");
	//}}AFX_DATA_INIT
}


void COpenGLInfoDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COpenGLInfoDlg)
	DDX_Control(pDX, IDC_LIST_OpenGLWGLExtensions, m_WGLExtensions);
	DDX_Control(pDX, IDC_LIST_OpenGLExtensions, m_Extensions);
	DDX_Text(pDX, IDC_STATIC_OpenGLCompany, m_Company);
	DDX_Text(pDX, IDC_STATIC_OpenGLRenderer, m_Renderer);
	DDX_Text(pDX, IDC_STATIC_OpenGLVersion, m_Version);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(COpenGLInfoDlg, CDialog)
	//{{AFX_MSG_MAP(COpenGLInfoDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COpenGLInfoDlg message handlers

BOOL COpenGLInfoDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();

	// Add extension strings to the list box

	int cursor = 0;
	while ((cursor = m_strExtensions.Find(" ")) != -1)
	{
		m_Extensions.AddString(m_strExtensions.Mid(0, cursor));
		m_strExtensions.Delete(0, cursor + 1);
	}
	
	cursor = 0;
	while ((cursor = m_strWGLExtensions.Find(" ")) != -1)
	{
		m_WGLExtensions.AddString(m_strWGLExtensions.Mid(0, cursor));
		m_strWGLExtensions.Delete(0, cursor + 1);
	}

	UpdateData(TRUE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
